package main

import "fmt"

func main() {
	var arr = []int{7, 1, 5, 3, 6, 4}
	max := 0
	for i :=0;i <len(arr)-1;i++{
		if tem :=arr[i+1]-arr[i];tem > 0{
			max += tem
		}
	}
	fmt.Println(max)
}
